﻿@model Base_Code
@{
    ViewBag.Title = "Edit";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="main-container">
    <div class="modal-form">
        <div class="modal-form-body">
            <form id="Form" method="post" action="@Url.Action("CodeEdit", "System")" class="form-horizontal margin10-t">
                @Html.HiddenFor(m => Model.ID)
                <div class="contrl">
                    <label>类型号：</label>
                    @Html.TextBox("Type_Code", Model.Type_Code, new { @class = "input", @readonly = "readonly" })
                </div>
                <div class="contrl">
                    <label>码名称：</label>
                    @Html.TextBox("Data_Value", Model.Data_Value, new { @class = "input" })
                </div>
                <div class="contrl">
                    <label>码号：</label>
                    @Html.TextBox("Data_Key", Model.Data_Key, new { @class = "input" })
                </div>
                <div class="contrl">
                    <label>序号：</label>
                    @Html.TextBox("Data_Seq", Model.Data_Seq, new { @class = "input" })
                </div>
                <div class="contrl">
                    <label>分类：</label>
                    @Html.TextBox("Data_Type", Model.Data_Type, new { @class = "input" })
                </div>
            </form>
        </div>
        <div class="modal-form-footer">
            <input type="button" class="btn-primary" value="保存" onclick="EditSubmit('System', 'CodeEdit', 'CodeList')" />
            <input type="button" class="btn-secondary" value="取消" onclick="CloseModelFrame()">
        </div>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $("#Form").validate({
            rules: {
                Type_Code: { required: true },
                Data_Value: { required: true },
                Data_Key: { required: true },
                Data_Seq: { required: true }
            },
            messages: {
                Type_Code: {
                    required: "请选择码类型",

                },
                Data_Value: {
                    required: "请输入码名称"
                },
                Data_Key: {
                    required: "请输入码号"
                },
                Data_Seq: {
                    required: "请输入序号"
                }
            },
            errorElement: "em"
        });
    });
</script>